@import be.objectify.deadbolt.scala.AuthenticatedRequest
@import be.objectify.deadbolt.scala.views.html._
@(handler: be.objectify.deadbolt.scala.DeadboltHandler)(implicit request: AuthenticatedRequest[Any])

<div class="row-fluid" id="template-subjectPresent">
    <div class="span10">
        <h3 class="subsection">subjectPresent</h3>

        <p>This is one of the simplest constraints in Deadbolt.  It simply requires that a user be present (i.e. logged in).</p>
    </div>
</div>
<div class="row-fluid">
    <div class="span3 columnHeader">Unprotected content</div>
    <div class="span5 columnHeader">Specification</div>
    <div class="span2 columnHeader">Result</div>
</div>

<div class="row-fluid">
    <div class="span3">
        <pre>This content should be visible</pre>
    </div>
    <div class="span5">
        <pre>
@@subjectPresent(handler) {
  This content should be visible
}</pre>
    </div>
    <div class="span2">
@subjectPresent() {
  This content should be visible
}
    </div>
</div>

<div class="row-fluid">
    <div class="span3">
        <pre>This content should NOT be visible</pre>
    </div>
    <div class="span5">
        <pre>
@@subjectPresent(new security.MyUserlessDeadboltHandler) {
  This content should NOT be visible
}</pre>
    </div>
    <div class="span2">
        @subjectPresent(new security.MyUserlessDeadboltHandler) {
        This content should NOT be visible
        }
    </div>
</div>

<div class="row-fluid">
    <div class="span3">
        <pre>This content should be visible</pre>
    </div>
    <div class="span5">
        <pre>
@@subjectPresentOr(handler) {
  This content should be visible
}{Sorry, no access}</pre>
    </div>
    <div class="span2">
        @subjectPresentOr(handler) {
        This content should be visible
        }{Sorry, no access}
    </div>
</div>


<div class="row-fluid">
    <div class="span3">
        <pre>This content should NOT be visible</pre>
    </div>
    <div class="span5">
        <pre>
@@subjectPresentOr(new security.MyUserlessDeadboltHandler) {
  This content should be NOT visible
}{Sorry, no access}</pre>
    </div>
    <div class="span2">
        @subjectPresentOr(new security.MyUserlessDeadboltHandler) {
        This content should be NOT visible
        }{Sorry, no access}
    </div>
</div>